<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/kernel/qmime_mac.cpp -->
<head>
  <title>Qt 4.3: QMacPasteboardMime Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QMacPasteboardMime Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QMacPasteboardMime class maps open-standard MIME to Mac flavors. <a href="#details">More...</a></p>
<pre> #include &lt;QMacPasteboardMime&gt;</pre><p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qmacpasteboardmime-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qmacpasteboardmime.html#QMacPasteboardMime">QMacPasteboardMime</a></b> ( char <i>t</i> )</li>
<li><div class="fn"/>virtual <b><a href="qmacpasteboardmime.html#dtor.QMacPasteboardMime">~QMacPasteboardMime</a></b> ()</li>
<li><div class="fn"/>virtual bool <b><a href="qmacpasteboardmime.html#canConvert">canConvert</a></b> ( const QString &amp; <i>mime</i>, QString <i>flav</i> ) = 0</li>
<li><div class="fn"/>virtual QList&lt;QByteArray&gt; <b><a href="qmacpasteboardmime.html#convertFromMime">convertFromMime</a></b> ( const QString &amp; <i>mime</i>, QVariant <i>data</i>, QString <i>flav</i> ) = 0</li>
<li><div class="fn"/>virtual QVariant <b><a href="qmacpasteboardmime.html#convertToMime">convertToMime</a></b> ( const QString &amp; <i>mime</i>, QList&lt;QByteArray&gt; <i>data</i>, QString <i>flav</i> ) = 0</li>
<li><div class="fn"/>virtual QString <b><a href="qmacpasteboardmime.html#convertorName">convertorName</a></b> () = 0</li>
<li><div class="fn"/>virtual QString <b><a href="qmacpasteboardmime.html#flavorFor">flavorFor</a></b> ( const QString &amp; <i>mime</i> ) = 0</li>
<li><div class="fn"/>virtual QString <b><a href="qmacpasteboardmime.html#mimeFor">mimeFor</a></b> ( QString <i>flav</i> ) = 0</li>
</ul>
<a name="static-public-members"></a>
<h3>Static Public Members</h3>
<ul>
<li><div class="fn"/>QList&lt;QMacPasteboardMime *&gt; <b><a href="qmacpasteboardmime.html#all">all</a></b> ( uchar <i>t</i> )</li>
<li><div class="fn"/>QMacPasteboardMime * <b><a href="qmacpasteboardmime.html#convertor">convertor</a></b> ( uchar <i>t</i>, const QString &amp; <i>mime</i>, QString <i>flav</i> )</li>
<li><div class="fn"/>QString <b><a href="qmacpasteboardmime.html#flavorToMime">flavorToMime</a></b> ( uchar <i>t</i>, QString <i>flav</i> )</li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QMacPasteboardMime class maps open-standard MIME to Mac flavors.</p>
<p>Qt's drag and drop support and clipboard facilities use the MIME standard. On X11, this maps trivially to the Xdnd protocol, but on Mac although some applications use MIME types to describe clipboard formats, others use arbitrary non-standardized naming conventions, or unnamed built-in Mac formats.</p>
<p>By instantiating subclasses of QMacPasteboardMime that provide conversions between Mac flavors and MIME formats, you can convert proprietary clipboard formats to MIME formats.</p>
<p>Qt has predefined support for the following Mac flavors:</p>
<ul>
<li>kScrapFlavorTypeUnicode - converted to &quot;text/plain;charset=ISO-10646-UCS-2&quot;</li>
<li>kScrapFlavorTypeText - converted to &quot;text/plain;charset=system&quot; or &quot;text/plain&quot;</li>
<li>kScrapFlavorTypePicture - converted to &quot;application/x-qt-image&quot;</li>
<li>typeFileURL - converted to &quot;text/uri-list&quot;</li>
</ul>
<p>You can check if a MIME type is convertible using <a href="qmacpasteboardmime.html#canConvert">canConvert</a>() and can perform conversions with <a href="qmacpasteboardmime.html#convertToMime">convertToMime</a>() and <a href="qmacpasteboardmime.html#convertFromMime">convertFromMime</a>().</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QMacPasteboardMime"></a>QMacPasteboardMime::QMacPasteboardMime ( char <i>t</i> )</h3>
<p>Constructs a new conversion object of type <i>t</i>, adding it to the globally accessed list of available convertors.</p>
<h3 class="fn"><a name="dtor.QMacPasteboardMime"></a>QMacPasteboardMime::~QMacPasteboardMime ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Destroys a conversion object, removing it from the global list of available convertors.</p>
<h3 class="fn"><a name="all"></a><a href="qlist.html">QList</a>&lt;QMacPasteboardMime *&gt; QMacPasteboardMime::all ( <a href="qtglobal.html#uchar-typedef">uchar</a> <i>t</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Returns a list of all currently defined <a href="qmacpasteboardmime.html">QMacPasteboardMime</a> objects of type <i>t</i>.</p>
<h3 class="fn"><a name="canConvert"></a>bool QMacPasteboardMime::canConvert ( const <a href="qstring.html">QString</a> &amp; <i>mime</i>, <a href="qstring.html">QString</a> <i>flav</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns true if the convertor can convert (both ways) between <i>mime</i> and <i>flav</i>; otherwise returns false.</p>
<p>All subclasses must reimplement this pure virtual function.</p>
<h3 class="fn"><a name="convertFromMime"></a><a href="qlist.html">QList</a>&lt;<a href="qbytearray.html">QByteArray</a>&gt; QMacPasteboardMime::convertFromMime ( const <a href="qstring.html">QString</a> &amp; <i>mime</i>, <a href="qvariant.html">QVariant</a> <i>data</i>, <a href="qstring.html">QString</a> <i>flav</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns <i>data</i> converted from MIME type <i>mime</i> to Mac UTI <i>flav</i>.</p>
<p>Note that Mac flavors must all be self-terminating. The return value may contain trailing data.</p>
<p>All subclasses must reimplement this pure virtual function.</p>
<h3 class="fn"><a name="convertToMime"></a><a href="qvariant.html">QVariant</a> QMacPasteboardMime::convertToMime ( const <a href="qstring.html">QString</a> &amp; <i>mime</i>, <a href="qlist.html">QList</a>&lt;<a href="qbytearray.html">QByteArray</a>&gt; <i>data</i>, <a href="qstring.html">QString</a> <i>flav</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns <i>data</i> converted from Mac UTI <i>flav</i> to MIME type <i>mime</i>.</p>
<p>Note that Mac flavors must all be self-terminating. The input <i>data</i> may contain trailing data.</p>
<p>All subclasses must reimplement this pure virtual function.</p>
<h3 class="fn"><a name="convertor"></a>QMacPasteboardMime * QMacPasteboardMime::convertor ( <a href="qtglobal.html#uchar-typedef">uchar</a> <i>t</i>, const <a href="qstring.html">QString</a> &amp; <i>mime</i>, <a href="qstring.html">QString</a> <i>flav</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Returns the most-recently created <a href="qmacpasteboardmime.html">QMacPasteboardMime</a> of type <i>t</i> that can convert between the <i>mime</i> and <i>flav</i> formats. Returns 0 if no such convertor exists.</p>
<h3 class="fn"><a name="convertorName"></a><a href="qstring.html">QString</a> QMacPasteboardMime::convertorName ()&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns a name for the convertor.</p>
<p>All subclasses must reimplement this pure virtual function.</p>
<h3 class="fn"><a name="flavorFor"></a><a href="qstring.html">QString</a> QMacPasteboardMime::flavorFor ( const <a href="qstring.html">QString</a> &amp; <i>mime</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns the Mac UTI used for MIME type <i>mime</i>, or 0 if this convertor does not support <i>mime</i>.</p>
<p>All subclasses must reimplement this pure virtual function.</p>
<h3 class="fn"><a name="flavorToMime"></a><a href="qstring.html">QString</a> QMacPasteboardMime::flavorToMime ( <a href="qtglobal.html#uchar-typedef">uchar</a> <i>t</i>, <a href="qstring.html">QString</a> <i>flav</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Returns a MIME type of type <i>t</i> for <i>flav</i>, or 0 if none exists.</p>
<h3 class="fn"><a name="mimeFor"></a><a href="qstring.html">QString</a> QMacPasteboardMime::mimeFor ( <a href="qstring.html">QString</a> <i>flav</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns the MIME UTI used for Mac flavor <i>flav</i>, or 0 if this convertor does not support <i>flav</i>.</p>
<p>All subclasses must reimplement this pure virtual function.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
